package com.wuchao.util;

import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author wuchao66
 * @Date 2022/7/8 15:53
 * @Version 1.0
 */
public class BaseUserController {
    @InitBinder
    public void initBinder(WebDataBinder dataBinder){

        dataBinder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));
    }

}
